package galleryviewer;


import galleryviewer.Window;
import galleryviewer.GalleryFloor;
import galleryviewer.Local;
import javafx.scene.shape.*;
import javafx.scene.paint.Color;

import javafx.scene.input.MouseEvent;
import javafx.scene.Group;
import javafx.scene.text.Text;
import javafx.scene.text.Font;


/**
 * @author SiMet_2
 */
 
 
 public class WindowLista extends Window{
     override public var jakDojscButton = false;
     override public var tresc = getWindowContent();
     
     
     function getWindowContent() : Group{
          var i = 0;
          var j = 0;
          var newFloor = false;
          var windowContent = Group{
              content: [
                Text{
                    content: "Lista sklepow:" font: Font.font("Verdana",30)
                    translateX: 400
                }
              ]                 
              translateY: 50         
          } //Group lista sklepow
          for(floor in GalleryFloor.floors){
             if(floor.floorNumber!=0){
                i=0; 
                j++;
             }
             insert Text{
                content: "PIETRO {floor.floorNumber+1 }:";
                font: Font{embolden: true size: 16};
                translateY: 70 + 20*i++;
                translateX: 50 + 200*j;
                
             } into windowContent.content;
             i++;              
             for(local in floor.getLocals()){

             if(20*i+150>wysokosc){ i=0;  j++; }
             
             insert Text{
                content: local.getName();
                    translateY: 70 + 20*i++;
                     translateX: 50 + 200*j;
             } into windowContent.content;                                        
            }
        }//for floor
        return windowContent; 
      }
 }
